<% include ../header.ejs %>
<header data-am-widget="header" data-am-sticky class="am-header am-header-default" id="appTemplates-Nav">
    <script type="text/javascript" src="/lib/iscroll/iscroll.js"></script>
    <div class="am-header-left am-header-nav">
        <a href='/smtool_project/wxapp/'>
            <img class="am-header-icon-custom" src="data:image/svg+xml;charset&#x3D;utf-8,&lt;svg xmlns&#x3D;&quot;http://www.w3.org/2000/svg&quot; viewBox&#x3D;&quot;0 0 12 20&quot;&gt;&lt;path d&#x3D;&quot;M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z&quot; fill&#x3D;&quot;%23fff&quot;/&gt;&lt;/svg&gt;" alt=""/>
        </a>
    </div>

    <h1 class="am-header-title">
        <a href="#title-link" class="" id="Typeface-whitecolor">知识库首页</a>
    </h1>
    <div class="am-dropdown am-header-right am-header-nav" data-am-dropdown>
        <button class="am-btn am-btn-primary am-dropdown-toggle" data-am-dropdown-toggle>操作&nbsp;<span class="am-icon-caret-down"></span></button>
        <ul class="am-dropdown-content">
            <li class="am-divider"></li>
            <li>
                <a href="group">
                    <div class="am-padding-horizontal-sm">
                        <i class="am-header-icon am-icon-edit"></i>
                        &nbsp;&nbsp;子栏目项
                    </div>
                </a>
            </li>
            <li class="am-divider"></li>
            <li>
                <a href="add">
                    <div class="am-padding-horizontal-sm">
                        <i class="am-header-icon am-icon-upload"></i>
                        &nbsp;&nbsp;上传文档
                    </div>
                </a>
            </li>
            <li class="am-divider"></li>
            <li>
                <a href="manage">
                    <div class="am-padding-horizontal-sm">
                        <i class="am-header-icon am-icon-cog"></i>
                        &nbsp;&nbsp;管理文档
                    </div>
                </a>
            </li>
        </ul>
    </div>
</header>
<div data-am-widget="tabs" class="am-tabs am-tabs-default"   ng-app="knowledgeList" ng-controller="listController" >

    <div class="am-btn-group am-btn-group-justify" data-am-sticky="{top:60}">
        <a class="am-btn am-btn-default " ng-class="changeGroupId== item.id?'am-active':''" role="button" ng-click = "typeChange(item.id)" ng-repeat="item in types">{{item.name}}</a>
    </div>



<div class="am-container" style="padding-left:0rem;padding-right:0rem;height: calc(100vh - 122px);overflow-y:scroll;margin-top: 40px" >
    <ul class="am-list admin-sidebar-list" id="{{changeGroupId}}" style="margin-top: 1rem;">
        <li  class="am-panel" ng-repeat="g in groupList " >
           <a data-am-collapse="{parent: '{{'#'+changeGroupId}}', target: '{{'#'+g.name}}'}"  style = "margin-left: 15px">{{g.name}}
               <span class=" am-fr am-margin-right">{{g.centers.length}}</span> <i class="am-icon-angle-right am-fr am-margin-right" ng-show="g.centers.length >0"></i>
            </a>
            <div class="am-panel am-panel-secondary am-collapse " style="margin: 3px" ng-repeat="file in g.centers" id="{{g.name}}">
                <div class="am-panel-hd am-g" style="padding: .4rem 0.4rem;">
                        <i class="am-u-sm-1 am-icon-file-text-o "  ng-click="toDownLoad(file.attachmentUrl)"></i>
                        <a class = "am-u-sm-5 am-text-truncate" href = "javascript:;" ng-click="toDetail(file.rowId)"><span>{{file.attachmentName||''}}</span>
                        </a>
                    <div class="am-u-sm-5  am-list-item-hd am-text-sm" style="width:50%">
                    {{formateDate(file.createdAt) + '/' + (file.createUser || '')}}
                    </div>
            </div>
                <div class="am-panel-bd am-list-item-text am-margin-left-sm line-clamp " style="    padding: 1rem 1rem 0.3rem 0.5rem;">
                    {{file.content||''}}
                </div>
            </div>
        </li>
    </ul>
    <div class="am-panel am-panel-secondary  " style="margin: 3px" ng-repeat="file in parentCenters" >
        <div class="am-panel-hd am-g" style="padding: .4rem 0.4rem;">
            <i class="am-u-sm-1 am-icon-file-text-o "  ng-click="toDownLoad(file.attachmentUrl)"></i>
            <a class = "am-u-sm-5 am-text-truncate" href = "javascript:;" ng-click="toDetail(file.rowId)"><span>{{file.attachmentName||''}}</span>
            </a>
            <div class="am-u-sm-5  am-list-item-hd am-text-sm" style="width:50%">
                {{formateDate(file.createdAt) + '/' + (file.createUser || '')}}
            </div>
        </div>
        <div class="am-panel-bd am-list-item-text am-margin-left-sm line-clamp " style="    padding: 1rem 1rem 0.3rem 0.5rem;">
            {{file.content||''}}
        </div>
    </div>
</div>
</div>

<style type="text/css">
    .line-clamp {
        overflow : hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    #wrapper {
        position: absolute;
        z-index: 1;
        top: 95px;
        bottom: -10px;
        left: 0;
        width: 100%;
        background: #f8f8f8;
        overflow: hidden;
    }
    #scroller {
        position: absolute;

        z-index: 1;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        width: 100%;
        -webkit-transform: translateZ(0);
        -moz-transform: translateZ(0);
        -ms-transform: translateZ(0);
        -o-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-text-size-adjust: none;
        -moz-text-size-adjust: none;
        -ms-text-size-adjust: none;
        -o-text-size-adjust: none;
        text-size-adjust: none;
    }

</style>
<script src="/javascripts/app/knowledge/knowledge.js"></script>

<% include ../footer.ejs %>